
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>角色管理</title>
    <#--<%@include file="/WEB-INF/views/common/link.jsp" %>-->
    <#include "../common/link.ftl">
    <script src="/js/plugins/messager/jquery.bootstrap.min.js"></script>
    <script src="js/jquery/jquery.min.js"></script>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
   <#-- <%@include file="/WEB-INF/views/common/navbar.jsp" %>-->
    <#include "../common/navbar.ftl">
    <!--菜单回显-->
 <#--   <c:set var="currentMenu" value="role"/>-->
       <#assign currentMenu="role">
 <#--   <%@include file="/WEB-INF/views/common/menu.jsp" %>-->
       <#include "../common/menu.ftl">
    <div class="content-wrapper">
        <section class="content-header">
            <h1>角色管理</h1>
        </section>
        <section class="content">
            <div class="box">
                <!--高级查询--->
                <div style="margin: 10px;">
                    <!--高级查询--->
                    <form class="form-inline" id="searchForm" action="/role/list.do" method="post">
                        <input type="hidden" name="currentPage" id="currentPage" value="1">
                        <a href="/role/input.do" class="btn btn-success btn_redirect"><span
                                class="glyphicon glyphicon-plus"></span> 添加</a>
                    </form>

                    <table class="table table-striped table-hover">
                        <thead>
                        <tr>
                            <th>编号</th>
                            <th>角色名称</th>
                            <th>角色编号</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <#list pageResult.list as role>

                            <tr>
                                <td>${role_index+1}</td>
                                <td>${role.name!}</td>
                                <td>${role.sn!}</td>
                                <td>
                                    <a href="/role/input.do?id=${role.id}" class="btn btn-info btn-xs btn_redirect">
                                        <span class="glyphicon glyphicon-pencil"></span> 编辑
                                    </a>
                                    <a href="#" class="btn btn-danger btn-xs btn_delete" data-xxx="${role.id}">
                                        <span class="glyphicon glyphicon-trash"></span> 删除
                                    </a>
                                </td>
                            </tr>
                        </#list>
                    </table>
                    <!--分页-->
                    <script>
                        $(function () {
                            $(".btn_delete").click(function () {
                                var $a = $(this);
                                var roleId = $a.data("xxx");

                                $.messager.model = {
                                    ok: {text: '确认'},
                                    cancel: {text: '取消'}
                                }
                                $.messager.confirm('警告', '数据将被删除!', function () {
                                    $.get("/role/delete.do","id="+roleId,function (data) {
                                        if (data.success){
                                            $.messager.popup("删除成功,两秒后自动刷新");
                                            setTimeout(function () {
                                                window.location.reload();
                                            },2000);
                                        }else {
                                            $.messager.popup("删除失败");
                                        }
                                    })
                                })
                            })
                        })
                    </script>
                   <#-- <%@include file="/WEB-INF/views/common/page.jsp" %>-->
                    <#include "../common/page.ftl">
                </div>
            </div>
        </section>
    </div>
   <#-- <%@include file="/WEB-INF/views/common/footer.jsp" %>-->
    <#include "../common/footer.ftl">
</div>




  <#--模态框-->
<#--<div class="modal fade" id="inputModel" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">角色添加编辑</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" action="/department/saveOrUpdate.do" method="post" id="editForm">
                    <input type="text"  name="id" hidden>
                    <div class="form-group" style="margin-top: 10px;">
                        <label for="name" class="col-sm-2 control-label">名称：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" id="name" name="name"
                                   placeholder="请输入部门名">
                        </div>
                    </div>
                    <div class="form-group" style="margin-top: 10px;">
                        <label for="sn" class="col-sm-2 control-label">编码：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" id="sn" name="sn"
                                   placeholder="请输入部门编码">
                        </div>
                    </div>

                </form>


            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary btn-submit">保存</button>
            </div>
        </div><!-- /.modal-content &ndash;&gt;
    </div><!-- /.modal-dialog &ndash;&gt;-->
</body>
</html>
